# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-cleo
pkgver=2.1.0
pkgrel=0
pkgdesc="Python3 library to create beautiful and testable command-line interfaces"
url="https://github.com/python-poetry/cleo"
arch="noarch"
license="MIT"
depends="python3 py3-crashtest py3-rapidfuzz"
makedepends="py3-gpep517 py3-poetry-core"
checkdepends="py3-pytest py3-pytest-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-poetry/cleo/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/cleo-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
e73a4c02470052f0f602fae8b5bf7073f3342d0816074398b19f0fb25caddda51b6d2fcb9ef57026638d0dc8861a2b5142d87551b105cefa5e54426e4aa1225c  py3-cleo-2.1.0.tar.gz
"
